package com.mes.biz.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.mes.common.core.domain.BaseEntity;
import com.mes.common.core.service.BaseServiceImpl;
import com.mes.biz.mapper.BizProductInventoryBookMapper;
import com.mes.biz.domain.BizProductInventoryBook;
import com.mes.biz.service.BizProductInventoryBookService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 库存台账Service业务层处理
 * @author hwg
 * @email hwg
 * @date 2023-06-01
 */
@Service
@Transactional(readOnly = true)
public class BizProductInventoryBookServiceImpl extends BaseServiceImpl<BizProductInventoryBookMapper, BizProductInventoryBook> implements BizProductInventoryBookService {

    private static final Logger log = LoggerFactory.getLogger(BizProductInventoryBookServiceImpl.class);

    /**
     * 获取单条数据
     * @param bizProductInventoryBook 库存台账
     * @return 库存台账
     */
    @Override
    public BizProductInventoryBook get(BizProductInventoryBook bizProductInventoryBook) {
        BizProductInventoryBook dto = super.get(bizProductInventoryBook);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 库存台账id
     * @return 库存台账
     */
    @Override
    public BizProductInventoryBook get(String id) {
        BizProductInventoryBook dto = super.get(id);
        return dto;
    }

    /**
     * 查询库存台账列表
     * @param bizProductInventoryBook 库存台账
     * @return 库存台账
     */
    @Override
    public List<BizProductInventoryBook> findList(BizProductInventoryBook bizProductInventoryBook) {
        List<BizProductInventoryBook> bizProductInventoryBookList = super.findList(bizProductInventoryBook);
        return bizProductInventoryBookList;
    }

    /**
     * 分页查询库存台账列表
     * @param bizProductInventoryBook 库存台账
     * @return 库存台账
     */
    @Override
    public PageInfo<BizProductInventoryBook> findPage(BizProductInventoryBook bizProductInventoryBook) {
		PageInfo<BizProductInventoryBook> page = super.findPage(bizProductInventoryBook);
        return page;
    }

    /**
     * 保存库存台账
     * @param bizProductInventoryBook
     * @return 结果
     */
    @Override
    public boolean save(BizProductInventoryBook bizProductInventoryBook) {
        return super.save(bizProductInventoryBook);
    }

    /**
     * 删除库存台账信息
     * @param bizProductInventoryBook
     * @return 结果
     */
    @Override
    public boolean remove(BizProductInventoryBook bizProductInventoryBook) {
        return super.remove(bizProductInventoryBook);
    }

    /**
     * 批量删除库存台账
     * @param ids 需要删除的库存台账ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBizProductInventoryBookByIds(String[] ids) {
        return mapper.deleteBizProductInventoryBookByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

    @Transactional(readOnly = false)
    @Override
    public int deleteBizProductInventoryBookByOrderNumber(String orderNumber) {
        return mapper.deleteBizProductInventoryBookByOrderNumber(orderNumber, BaseEntity.DEL_FLAG_DELETE);
    }

    @Override
    public BizProductInventoryBook selectBizProductInventoryBookByOrderNumber(String orderNumber,String spaceId,String productId) {
        return mapper.selectBizProductInventoryBookByOrderNumber(orderNumber,spaceId,productId);
    }

}
